import request from '@/config/axios'

// ERP 出入库规则 VO
export interface OutInRuleVO {
  id: number // id
  ruleType: string // 规则类型
  rule: string // 规则
}

// ERP 出入库规则 API
export const OutInRuleApi = {
  // 查询ERP 出入库规则分页
  getOutInRulePage: async (params: any) => {
    return await request.get({ url: `/erp/out-in-rule/page`, params })
  },

  // 查询ERP 出入库规则详情
  getOutInRule: async (id: number) => {
    return await request.get({ url: `/erp/out-in-rule/get?id=` + id })
  },

  // 新增ERP 出入库规则
  createOutInRule: async (data: OutInRuleVO) => {
    return await request.post({ url: `/erp/out-in-rule/create`, data })
  },

  // 修改ERP 出入库规则
  updateOutInRule: async (data: OutInRuleVO) => {
    return await request.put({ url: `/erp/out-in-rule/update`, data })
  },

  // 删除ERP 出入库规则
  deleteOutInRule: async (id: number) => {
    return await request.delete({ url: `/erp/out-in-rule/delete?id=` + id })
  },

  // 导出ERP 出入库规则 Excel
  exportOutInRule: async (params) => {
    return await request.download({ url: `/erp/out-in-rule/export-excel`, params })
  },
}